﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Laegevagten_OUH
{

    public partial class MainWindow : Window
    {
     
        Kø kø;

        public MainWindow()
        {
            kø = new Kø();
            InitializeComponent();
            
            kø.nyPatient(new Patient(1, 25));
            kø.nyPatient(new Patient(2, 15));
            kø.nyPatient(new Patient(3, 30));
            kø.nyPatient(new Patient(4, 10));
            kø.nyPatient(new Patient(5, 30));
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dtgListe.ItemsSource = kø.PatientListe;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                long temp = long.Parse(txtCPR.Text);

                lblVentetid.Content = "Forventet ventetid: " + kø.Ventetid(temp).ToString() + " minutter";
            }
            catch
            {
                MessageBox.Show("forkert parameter");
            }

          
            
        }
    }
}
